import java.util.Scanner;

public class newed {
    public static void main(String[] args) {
        int[] arr1 = {1,2,3};

        int[] arr2 = {10,20,30,40,50};
        arr2[0] = 100;
        arr2[1] = 200;

        arr1 = arr2;
        arr1[2] = 300;
        arr1[3] = 400;
        arr2[4] = 500;

    }

    public static void main20(String[] args) {
        int a = 10;
        int b = 20;
        int[] arr = new int[]{1, 2, 3};


        int[] array = {1,2,3,4};

        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }
        System.out.println();

        //增强for循环  for-each
        for (int x : array){
            System.out.print(x + " ");
        }

    }

    public static void main19(String[] args) {
        int[] arry = null;//局部变量
        System.out.println(arry);


        int n = 10;
        int[] arr2 = new int[n];


        int[] arr3 = new int[10];
        System.out.println(arr3.length);

    }

    public static void main18(String[] args) {
        //汉诺塔

    }
    public static void move(char pos1, char pos2){
        System.out.println(pos1+ "->" + pos2);
    }

    public static void Hanoi(int n, char pos1, char pos2, char pos3){
        //pos1:起始站
        //pos2:中转站
        //pos3:终点站

        //当仅剩1个盘子时，直接放在pos3上
        if (n == 1){
            move(pos1, pos3);
        }else{
            //剩余的 n - 1 个盘子通过 pos3 放在 pos2上
            Hanoi(n - 1, pos1, pos3, pos2);
            move(pos1, pos3);
            //最后通过 pos1 放在 pos3 上
            Hanoi(n - 1, pos2, pos1, pos3);
        }
    }


    public static void main17(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        System.out.println(EveryNumSum(input));
    }

    public static int EveryNumSum(int n){
        if (n < 10){
            return n % 10;
        }
        return n % 10 + EveryNumSum(n / 10);
    }

    public static void main16(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        Oder(input);
    }

    public static void Oder(int a){
        if (a / 10 > 0){
            Oder(a / 10);
        }
        System.out.print(a % 10 + " ");

    }


    public static void main15(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        System.out.println(Sum(input));
    }

    public static int Sum(int n){
        if (n == 1){
            return 1;
        }
        return n + Sum(n - 1);
    }


    public static void main14(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        System.out.println(Fac(input));
    }

    public static int Fac(int n){
        if (n == 1){
            return 1;
        }
        return n * Fac(n - 1);
    }

    public static void main13(String[] args) {
        System.out.println(Max(1, 5));
        System.out.println(Max(1.5, 88.9, 9.0));
    }
    public static int Max(int a, int b){
        return a > b ? a : b;
    }

    public static double Max(double a, double b, double c){
        double m = a > b ? a : b;
        return m > c ? m : c;
    }

    public static void main12(String[] args) {
        System.out.println(Add(2, 3));
        System.out.println(Add(2.5, 1.0, 3.5));
    }
    public static int Add(int a, int b){
        return a + b;
    }
    public static double Add(double a, double b, double c){
        return a + b + c;
    }

    public static void main11(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        System.out.println(FeiBo(input));
    }

    public static int FeiBo(int n){
        if(n <= 2){
            return 1;
        }
        return FeiBo(n - 1) + FeiBo(n - 2);
    }


    public static void main10(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        System.out.println(facSum(input));
    }

    public static int fac(int n){
        int ret = 1;
        for (int i = 1; i <= n; i++) {
            ret *= i;
        }
        return ret;
    }

    public static int facSum(int n){
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += fac(i);
        }
        return sum;
    }

    public static void main9(String[] args) {
        int a = 1, b = 9, c = 5;
        System.out.println(max3(a, b, c));
    }

    public static int max2(int a, int b){
        return a > b ? a : b;
    }
    public static int max3(int a, int b, int c){
        return max2(a, b) > c ? max2(a, b) : c;
    }

    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int count = 3;
        String password = "1234";
        while(count > 0){
            System.out.println("请输入密码：");
            String get = scanner.nextLine();
            if (get.equals(password)){
                System.out.println("登陆成功!");
                break;
            }else {
                count--;
            }
        }
        if (count == 0){
            System.out.println("登陆失败");
        }
    }

    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        while (a > 0){
            System.out.print(a % 10 + " ");
            a /= 10;
        }
    }

    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        for (int i = 1; i <= a; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(i + "*" + j +" = "+ i * j + " ");
            }
            System.out.println();
        }
    }

    public static int add(int a, int b) {
        return a + b;
    }

    public static int add(int a, int b, int c) {
        return a + b;
    }

    public static double add(double a, double b) {
        return a + b;
    }

    public static void main5(String[] args) {
        System.out.println(add(1, 3));
        System.out.println(add(1.7, 1.5));
        System.out.println(add(1, 2, 3));
    }


    public static int sum(int a, int b){
        return a + b;
    }

    public static void main4(String[] args) {
        System.out.println(sum(10, 50));
    }


    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        scanner.close();
    }



    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        System.out.println("奇数位是：");
        //打印奇数位
        for (int i = 30; i >= 0; i -= 2) {
            System.out.print((a >> i) & 1);
        }
        System.out.println("\n偶数位是：");
        for (int i = 31; i > 0; i -= 2) {
            System.out.print((a >> i) & 1);
        }
    }
    public static void main1(String[] args) {
        String a = "1234";
        String b = "1234";
        if (a.equals(b)){
            System.out.println("相等");
        }
    }
}
